# Contributor: Coco Liliace <coco@liliace.dev>
# Maintainer: Coco Liliace <coco@liliace.dev>
pkgname=xremap-wlr
pkgver=0.8.12
pkgrel=0
pkgdesc="Key remapper for Wayland"
url="https://github.com/k0kubun/xremap"
# nix
arch="all !s390x !riscv64"
license="MIT"
makedepends="cargo cargo-auditable"
replaces="xremap-sway"
source="$pkgname-$pkgver.tar.gz::https://github.com/k0kubun/xremap/archive/v$pkgver.tar.gz"
builddir="$srcdir/xremap-$pkgver"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release --features wlroots
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin ./target/release/xremap
}

sha512sums="
a679328be9451d1cb469905118fb3af444d0fc0765e8dd6ae2dddf34b0bc0d2a6b2c9a73a8f97547ce0b6cc752dfc49c3cf4c82ed48aa52304d6997c3f9071d3  xremap-wlr-0.8.12.tar.gz
"
